<?php include('config.php') ?>
<?php
session_start();
$survey_ID=$_SESSION['survey_ID'];
$sql = "SELECT * FROM `question` WHERE `survey_ID`='".$survey_ID."'";
$data = mysql_query($sql) or die('Error completing query: '.mysql_error());
echo "<form action=\"./phpScripts/submitSurvey.php\" method=\"post\">";
while($info = mysql_fetch_array( $data))
{
        echo "<div>".$info['question_text']."</div>";
        echo "<input type=\"radio\" name=\"".$info['ID']."\" value='1'>1";
        echo "<input type=\"radio\" name=\"".$info['ID']."\" value='2'>2";
        echo "<input type=\"radio\" name=\"".$info['ID']."\" value='3'>3";
        echo "<input type=\"radio\" name=\"".$info['ID']."\" value='4'>4";
        echo "<input type=\"radio\" name=\"".$info['ID']."\" value='5'>5";
}
echo "<div><input type=\"button\" name=\"button\" value=\"Submit Survey\"".
        "onClick=\"submit_survey(this.form)\"/></div>";
echo "</form>";
?>